-- GENERATED SPELL FOR [Valgarde Defender] --


function spell0_23739(pUnit, Event) --@Heroic Strike,n/a--
pUnit:FullCastSpellOnTarget(31827,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23739', 568, 1)
end

function spell1_23739(pUnit, Event) --@Revenge,n/a--
pUnit:FullCastSpellOnTarget(12170,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23739', 576, 1)
end

function spell2_23739(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(23337,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23739', 627, 1)
end

function spell3_23739(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(42476,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23739', 595, 1)
end

function Sorts_23739(pUnit, Event)
local choix_sorts_23739 = math.random(0, 3)
if choix_sorts_23739 == 0 then
pUnit:RegisterEvent('spell0_23739', 1, 1)
end
if choix_sorts_23739 == 1 then
pUnit:RegisterEvent('spell1_23739', 1, 1)
end
if choix_sorts_23739 == 2 then
pUnit:RegisterEvent('spell2_23739', 1, 1)
end
if choix_sorts_23739 == 3 then
pUnit:RegisterEvent('spell3_23739', 1, 1)
end
end

function mob23739_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23739', math.random(1500, 3000), 1)
end

function mob23739_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23739_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23739_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23739, 1, 'mob23739_Action')
RegisterUnitEvent(23739, 2, 'mob23739_Leave')
RegisterUnitEvent(23739, 3, 'mob23739_Kill')
RegisterUnitEvent(23739, 4, 'mob23739_Die')
